﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

// -----------------------------------------------------------------------
// <copyright file="$safeitemrootname$.cs" company="$registeredorganization$">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace NewGame
{
    public class NormalPerspectiveCamera : PerspectiveCamera
    {
        public override void UpdateCameraInfo(Fighter fighter)
        {
            base.UpdateCameraInfo(fighter);

            CameraPosition = fighter.Position + new Vector3(
                (ZoomRate) * (float)Math.Sin(fighter.LookRotationY + MathHelper.Pi - 0.1f),
                 0.5f*ZoomRate*(1  +(float)Math.Sin(-fighter.LookRotationZ)),
                 (ZoomRate) * (float)(Math.Cos(fighter.LookRotationY + MathHelper.Pi - 0.1f) * Math.Cos(fighter.LookRotationZ)));

            CameraTarget = fighter.Position + 
                new Vector3(30 * (float)Math.Sin(fighter.LookRotationY), 
                    30 * (float)Math.Sin(fighter.LookRotationZ), 
                    30 * (float)(Math.Cos(fighter.LookRotationY) * Math.Cos(fighter.LookRotationZ)));
        }

        public override void UpdateCameraInfo()
        {
            base.UpdateCameraInfo();

            CameraPosition = new Vector3(ZoomRate * (float)Math.Sin(RotationY + MathHelper.Pi - 0.2f),
                 ZoomRate / 2, ZoomRate * (float)Math.Cos(RotationY + MathHelper.Pi - 0.2f));
            CameraTarget = new Vector3(50 * (float)Math.Sin(RotationY), 0, 50 * (float)Math.Cos(RotationY));
        }
    }
}
